const mongoose = require('mongoose');
// 创建集合 schema 结构

const itemSchema = new mongoose.Schema({
  itemName: { // 商品名称
    type: String,
    required: true
  },
  itemPrice: { // 价格
    type: Number,
    required: true
  },
  itemNum: { // 库存
    type: Number,
    default: 0
  },
  itemDesc: {
    type: String,
    default: ''
  }, // 描述
  itemThumb: {
    type: String,
    default: ''
  },// 封面图片
  content: {
    type: String,
    default: ''
  }
})

// 创建集合
const itemModel = mongoose.model('qf_items', itemSchema);

module.exports = itemModel;